/**
 * 
 */
package GUI;

import java.awt.*;

import javax.swing.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

/**
 * @author aviat
 *
 */
public class UpdateWorkerDetails_1 extends JPanel {
	
	private static final long serialVersionUID = 1L;
	private JTextField userNameTextField;
	private JButton btnChange;
	/**
	 * @return the userNameTextField
	 */


	private JButton btnBack;
	private JTextField LastNameTextField;
	private JTextField PhoneNumberTextField;
	private JTextField EmailAddressTextField;
	private JTextArea HomeAddressTextArea;
	private JLabel iconlabel;
	private JLabel lblUpdateWorkerDetails;
	private JScrollPane scrollPane;
	
	
	/**
	 * 
	 */
	public UpdateWorkerDetails_1() {
		setBackground(new Color(255, 51, 0));
		setLayout(null);
		userNameTextField = new JTextField();
		userNameTextField.setFont(new Font("Tahoma", Font.BOLD, 12));
		btnBack = new JButton("Back");
		btnBack.setIcon(new ImageIcon(UpdateWorkerDetails_1.class.getResource("/resources/back22.png")));
		btnChange = new JButton("Change");
		btnChange.setIcon(new ImageIcon(UpdateWorkerDetails_1.class.getResource("/resources/change.png")));
		LastNameTextField = new JTextField();
		LastNameTextField.setFont(new Font("Tahoma", Font.BOLD, 12));
		HomeAddressTextArea = new JTextArea();
		
		PhoneNumberTextField = new JTextField();
		PhoneNumberTextField.addKeyListener(new KeyAdapter() {
			public void keyTyped(KeyEvent evt) {
				char c = evt.getKeyChar();
				if(!(Character.isDigit(c) || (c==KeyEvent.VK_BACK_SPACE) || (c==KeyEvent.VK_DELETE))){
					getToolkit().beep();
					evt.consume();
				}
			}
		});
		PhoneNumberTextField.setFont(new Font("Tahoma", Font.BOLD, 12));
		EmailAddressTextField = new JTextField();
		EmailAddressTextField.setFont(new Font("Tahoma", Font.BOLD, 12));
		
		initialize();
		}

		private void initialize() {
		
		JLabel lblName = new JLabel("First Name");
		lblName.setForeground(Color.WHITE);
		lblName.setFont(new Font("Tahoma", Font.BOLD, 12));
		lblName.setBounds(10, 134, 107, 27);
		add(lblName);
		
		userNameTextField.setBounds(121, 135, 139, 27);
		add(userNameTextField);
		userNameTextField.setColumns(10);
		
		btnBack.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 12));
		btnBack.setBounds(10, 462, 101, 27);
		add(btnBack);
		
		btnChange.setFont(new Font("Tahoma", Font.BOLD, 12));
		btnChange.setBounds(474, 349, 113, 35);
		add(btnChange);
		
		JLabel lblLastName = new JLabel("Last Name");
		lblLastName.setForeground(Color.WHITE);
		lblLastName.setFont(new Font("Tahoma", Font.BOLD, 12));
		lblLastName.setBounds(10, 202, 107, 27);
		add(lblLastName);
		
		
		LastNameTextField.setBounds(121, 203, 139, 27);
		add(LastNameTextField);
		LastNameTextField.setColumns(10);
		
		JLabel lblPhoneNumber = new JLabel("Phone Number");
		lblPhoneNumber.setForeground(Color.WHITE);
		lblPhoneNumber.setFont(new Font("Tahoma", Font.BOLD, 12));
		lblPhoneNumber.setBounds(10, 275, 107, 27);
		add(lblPhoneNumber);
		
		JLabel lblEmailAddress = new JLabel("Email Address");
		lblEmailAddress.setForeground(Color.WHITE);
		lblEmailAddress.setFont(new Font("Tahoma", Font.BOLD, 12));
		lblEmailAddress.setBounds(10, 357, 107, 27);
		add(lblEmailAddress);
		
		
		PhoneNumberTextField.setBounds(121, 276, 139, 27);
		add(PhoneNumberTextField);
		PhoneNumberTextField.setColumns(10);
		
		EmailAddressTextField.setBounds(121, 358, 139, 27);
		add(EmailAddressTextField);
		EmailAddressTextField.setColumns(10);
		
		JLabel lblHomeAddress = new JLabel("Home Address");
		lblHomeAddress.setForeground(Color.WHITE);
		lblHomeAddress.setFont(new Font("Tahoma", Font.BOLD, 12));
		lblHomeAddress.setBounds(338, 134, 107, 27);
		add(lblHomeAddress);
		
		scrollPane = new JScrollPane();
		scrollPane.setBounds(460, 135, 175, 94);
		add(scrollPane);
		
		scrollPane.setViewportView(HomeAddressTextArea);
		HomeAddressTextArea.setFont(new Font("Tahoma", Font.BOLD, 12));
		
		
		HomeAddressTextArea.setColumns(10);
		
		
		ImageIcon LOGOImageIcon = new ImageIcon(getClass().getClassLoader().getResource("resources/camera-background3.png"));
		ImageIcon LOGO = new ImageIcon (LOGOImageIcon.getImage().getScaledInstance(-1, -1, java.awt.Image.SCALE_SMOOTH));
		
		lblUpdateWorkerDetails = new JLabel("Update Worker Details");
		lblUpdateWorkerDetails.setForeground(new Color(0, 204, 255));
		lblUpdateWorkerDetails.setFont(new Font("Tahoma", Font.BOLD, 16));
		lblUpdateWorkerDetails.setBounds(10, 11, 227, 27);
		add(lblUpdateWorkerDetails);
		
		iconlabel = new JLabel("");
		iconlabel.setIcon(LOGO);
		iconlabel.setBounds(0, 0, 786, 500);
		add(iconlabel);
	}
		
		/**
		 * @return userNameTextField
		 */
		public JTextField getUserNameTextField() {
			return userNameTextField;
		}

		/**
		 * @param userNameTextField the userNameTextField to set
		 */
		public void setUserNameTextField(JTextField userNameTextField) {
			this.userNameTextField = userNameTextField;
		}

		/**
		 * @return the btnChange
		 */
		public JButton getBtnChange() {
			return btnChange;
		}

		/**
		 * @param btnChange the btnChange to set
		 */
		public void setBtnChange(JButton btnChange) {
			this.btnChange = btnChange;
		}

		/**
		 * @return the btnBack
		 */
		public JButton getBtnBack() {
			return btnBack;
		}

		/**
		 * @param btnBack the btnBack to set
		 */
		public void setBtnBack(JButton btnBack) {
			this.btnBack = btnBack;
		}

		/**
		 * @return the lastNameTextField
		 */
		public JTextField getLastNameTextField() {
			return LastNameTextField;
		}

		/**
		 * @param lastNameTextField the lastNameTextField to set
		 */
		public void setLastNameTextField(JTextField lastNameTextField) {
			LastNameTextField = lastNameTextField;
		}

		/**
		 * @return the phoneNumberTextField
		 */
		public JTextField getPhoneNumberTextField() {
			return PhoneNumberTextField;
		}

		/**
		 * @param phoneNumberTextField the phoneNumberTextField to set
		 */
		public void setPhoneNumberTextField(JTextField phoneNumberTextField) {
			PhoneNumberTextField = phoneNumberTextField;
		}

		/**
		 * @return the emailAddressTextField
		 */
		public JTextField getEmailAddressTextField() {
			return EmailAddressTextField;
		}

		/**
		 * @param emailAddressTextField the emailAddressTextField to set
		 */
		public void setEmailAddressTextField(JTextField emailAddressTextField) {
			EmailAddressTextField = emailAddressTextField;
		}

		/**
		 * @return the homeAddressTextArea
		 */
		public JTextArea getHomeAddressTextArea() {
			return HomeAddressTextArea;
		}

		/**
		 * @param homeAddressTextArea the homeAddressTextArea to set
		 */
		public void setHomeAddressTextArea(JTextArea homeAddressTextArea) {
			HomeAddressTextArea = homeAddressTextArea;
		}


}
